package com.example.design.mediator;

/**
 * @description:抽象同事角色
 * @author hej
 * @date 2022/11/4 17:25
 */
public abstract class Colleague {
    private Mediator mediator;

    private String name;

    public Colleague(Mediator mediator, String name) {
        this.mediator = mediator;
        this.name = name;
    }

    /**
     * 从中介获取值
     * @return the value of mediator
     */
    public Mediator getMediator() {
        return mediator;
    }

    /**
     * 获取名称
     * @return the value of name
     */
    public String getName() {
        return name;
    }

    abstract void sendMessage(int stateChange);
}
